function formatDateString(date) {
  const year = date.getFullYear();
  const month = String(date.getMonth() + 1).padStart(2, '0');
  const day = String(date.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}

var str = "Thu Dec 07 2023 00:00:00 GMT+0800 (中国标准时间)"

var date = new Date(str)

var dateStr = formatDateString(date)

console.log(dateStr);